﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Domain
{
    /// <summary>
    /// 出库单明细表
    /// </summary>
    public class OutboundOrderDetail
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }
        /// <summary>
        /// 关联的出库单ID
        /// </summary>
        [Required]
        public int OutboundOrderId { get; set; }

        /// <summary>
        /// SKU (产品编码)
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string SKU { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [Required]
        [MaxLength(200)]
        public string ProductName { get; set; }

        /// <summary>
        /// 库存量
        /// </summary>
        public int StockQuantity { get; set; }

        /// <summary>
        /// 出库价格
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal OutboundPrice { get; set; }

        /// <summary>
        /// 出库数量
        /// </summary>
        [Required]
        public int Quantity { get; set; }

        /// <summary>
        /// FNSKU (亚马逊产品标识符)
        /// </summary>
        [MaxLength(100)]
        public string FNSKU { get; set; }

        /// <summary>
        /// 指定单号
        /// </summary>
        [MaxLength(100)]
        public string DesignatedOrderNumber { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(500)]
        public string Remark { get; set; }

        /// <summary>
        /// 增值服务 (如：箱子20*15*30())
        /// </summary>
        [MaxLength(200)]
        public string ValueAddedService { get; set; }

        /// <summary>
        /// 清点数量
        /// </summary>
        public int? CountedQuantity { get; set; }

        /// <summary>
        /// 产品规格型号
        /// </summary>
        [MaxLength(100)]
        public string Specification { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [MaxLength(20)]
        public string Unit { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [MaxLength(50)]
        public string BatchNumber { get; set; }

        /// <summary>
        /// 仓库ID
        /// </summary>
        public int WarehouseId { get; set; }

        /// <summary>
        /// 仓库名称
        /// </summary>
        [MaxLength(100)]
        public string WarehouseName { get; set; }

        /// <summary>
        /// 库区ID
        /// </summary>
        public int? StorageAreaId { get; set; }

        /// <summary>
        /// 库区名称
        /// </summary>
        [MaxLength(100)]
        public string StorageAreaName { get; set; }

        /// <summary>
        /// 库位ID
        /// </summary>
        public int? StorageLocationId { get; set; }

        /// <summary>
        /// 库位名称
        /// </summary>
        [MaxLength(100)]
        public string StorageLocationName { get; set; }

        // 导航属性
        /// <summary>
        /// 关联的出库单
        /// </summary>
        [ForeignKey("OutboundOrderId")]
        public virtual OutboundOrder OutboundOrder { get; set; }
    }
}
